@namespace BootstrapBlazor
@inherits BootstrapComponentBase
@implements IDisposable

<div class="@Classname" style="@Style" @attributes="@AdditionalAttributes" @onpointerover="@Stop" @onpointerleave="@Start">
    @if (ShowIndicators)
    {
        <div class="carousel-indicators">
            @foreach (var item in _items)
            {
                <button @onclick="_=>ActiveItemChanged(item,IsNextItem(item))" type="button" data-bs-target="#@item.Id"
                    class="@(item.Id==_activedItem?.Id?"active":"")"></button>
            }
        </div>
    }
    <div class="carousel-inner">
        <CascadingValue Value="@this" IsFixed>
            @ChildContent
        </CascadingValue>
    </div>
    <button @onclick="@Prev" class="carousel-control-prev" type="button" data-bs-slide="prev">
        <span class="carousel-control-prev-icon" aria-hidden="true"></span>
        <span class="visually-hidden">Previous</span>
    </button>
    <button @onclick="@Next" class="carousel-control-next" type="button" data-bs-slide="next">
        <span class="carousel-control-next-icon" aria-hidden="true"></span>
        <span class="visually-hidden">Next</span>
    </button>
</div>